package com.design.graduation.asdemo.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by lijinyuan on 2016/1/18 11:51.
 */
public class InfoEntity implements Parcelable {
    /**
     * 经度
     */
    private double lon;
    /**
     * 维度
     */
    private double lat;


    /**
     *
     */
    private String address;

    public InfoEntity() {
    }

    public InfoEntity(double lon, double lat, String address) {
        this.lon = Double.valueOf(String.format("%.6f", lon));
        this.lat = Double.valueOf(String.format("%.6f", lat));
        this.address = address;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(this.lon);
        dest.writeDouble(this.lat);
        dest.writeString(this.address);
    }

    protected InfoEntity(Parcel in) {
        this.lon = in.readDouble();
        this.lat = in.readDouble();
        this.address = in.readString();
    }

    public static final Parcelable.Creator<InfoEntity> CREATOR = new Parcelable.Creator<InfoEntity>() {
        public InfoEntity createFromParcel(Parcel source) {
            return new InfoEntity(source);
        }

        public InfoEntity[] newArray(int size) {
            return new InfoEntity[size];
        }
    };
}
